package com.starmark.auth.common.util;


import com.starmark.auth.common.dto.SecurityUser;

public class UserUtil {

    private static final ThreadLocal<SecurityUser> userHolder = new ThreadLocal<>();


    public static void add(SecurityUser sysUser) {
        userHolder.set(sysUser);
    }

    public static SecurityUser getCurrentUser() {
        return userHolder.get();
    }

    public static String getUserId() {
        return userHolder.get().getId();
    }


    public static void remove() {
        userHolder.remove();


    }

}